﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework;

namespace BeatEmUp.Menu
{
    class GameOverScreen
    {
        Texture2D gameOver;
        SpriteFont scoreFont;
        int playerScore = 0;
        bool gameOverVisible = false;
        Vector2 scorePosition;
        public GameOverScreen(ContentManager content)
        {
            scorePosition = new Vector2(512,768/2);
            LoadContent(content);
        }

        public void LoadContent(ContentManager content)
        {
            gameOver = content.Load<Texture2D>(@"Sprites\Misc\GameOver");
            scoreFont = content.Load<SpriteFont>(@"Fonts\Score");
        }

        public void Draw(SpriteBatch sb)
        {
            scorePosition = new Vector2(512 - (scoreFont.MeasureString("Score: " + playerScore.ToString())).X/2, 768 / 2);

            GameManager.customResolution.Draw(gameOver, new Rectangle(0, 0, 1024, 768), Color.White);
            sb.DrawString(scoreFont,"Score: " + playerScore.ToString() , GameManager.customResolution.ScaleToVector(new Vector2((int)scorePosition.X + 2, (int)scorePosition.Y)), Color.White, 0, Vector2.Zero, GameManager.customResolution.ScaleRatio(), SpriteEffects.None, 0.0f);

        }

        public bool IsVisible
        {
            get
            {
                return gameOverVisible;
            }
            set
            {
                gameOverVisible = value;
            }
        }
        public int Score
        {
            set
            {
                playerScore = value;
            }
            get
            {
                return playerScore;
            }
        }
    }
}
